﻿<UserControl x:Class="CapEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:my="clr-namespace:Caps.Console"
    xmlns:res="clr-namespace:Caps.Console.My.Resources"
    xmlns:Tools="clr-namespace:Tools.WindowsT.WPF.ControlsT;assembly=Tools.Windows"
    xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
    xmlns:ToolsWF="clr-namespace:Tools.WindowsT.FormsT;assembly=Tools.Windows"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:MyMy="clr-namespace:Caps.Console.My"
    xmlns:ToolsC="clr-namespace:Tools.WindowsT.WPF.ConvertersT;assembly=Tools.Windows"
    xmlns:m="clr-namespace:Wpf.Controls;assembly=Wpf.SplitButton"
    xmlns:convertersT="clr-namespace:Tools.WindowsT.WPF.ConvertersT;assembly=Tools.Windows"
    FocusManager.FocusedElement="{Binding ElementName=txtCapName}"             
>
    <UserControl.Resources>
        <convertersT:NullFalseConverter x:Key="NullFalseConverter"/>
        <my:ObjectImageConverter x:Key="ObjectImageConverter"/>
        <convertersT:FileNameConverter x:Key="FileNameConverter"/>
        <my:CountryCodeFlagConverter x:Key="CountryCodeFlagConverter"/>
        <sys:Int32 x:Key="i64">64</sys:Int32>
        <sys:Int32 x:Key="i256">256</sys:Int32>
        <ToolsC:NotBooleanValueConverter x:Key="NotBooleanValueConverter"/>
        
        <ContextMenu Name="cmnCC" ItemsSource="{x:Static res:Countries.Countries}" x:Key="cmnCC"  >
            <ContextMenu.ItemTemplate>
                <DataTemplate>
                    <MenuItem Name="mniCountry"  Click="mniCountry_Click">
                        <MenuItem.Header>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="auto" SharedSizeGroup="CountryName"/>
                                    <ColumnDefinition Width="auto" SharedSizeGroup="CountryCode"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="auto"/>
                                </Grid.RowDefinitions>
                                <TextBlock Grid.Column="0" Grid.Row="0" Text="{Binding Name, Mode=Oneway}"/>
                                <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Code2, Mode=OneWay}"/>
                            </Grid>
                        </MenuItem.Header>
                        <MenuItem.Icon>
                            <Image MaxHeight="16" MaxWidth="32"  Source="{Binding ImageSource, Mode=Oneway}" />
                        </MenuItem.Icon>
                    </MenuItem>
                </DataTemplate>
            </ContextMenu.ItemTemplate>
        </ContextMenu>

    </UserControl.Resources>

    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.ColumnDefinitions >
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="auto"/>
            <RowDefinition Height="auto"/>
        </Grid.RowDefinitions>
        <!--Naming-->
        <GroupBox Header="{x:Static res:Resources.txt_Naming}"  Grid.Column="0" Grid.Row="0" >
            <Grid >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Name}" Target="{Binding ElementName=txtCapName}" />
                <TextBox Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtCapName" my:AttachedProperties.SelectAllOnFocus="true" MaxLength="255" />
                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_TitleText}" Target="{Binding ElementName=txtMainText}"/>
                <TextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtMainText" my:AttachedProperties.SelectAllOnFocus="true" MaxLength="255" />
                <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_SubtitleText}" Target="{Binding ElementName=txtSubTitle}"/>
                <TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtSubTitle" my:AttachedProperties.SelectAllOnFocus="true" MaxLength="255" />
                <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_MainPicture}" Target="{Binding ElementName=txtMainPicture}"/>
                <TextBox Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtMainPicture" my:AttachedProperties.SelectAllOnFocus="true" MaxLength="255" />
                <Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Top" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_AnotherPictures}" Target="{Binding ElementName=txtAnotherPictures}"/>
                <TextBox Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtAnotherPictures" AcceptsReturn="True" MinLines="2" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" MaxLines="2" my:AttachedProperties.SelectAllOnFocus="true"/>
                <Label Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_PictureType}" Target="{Binding ElementName=cmbPictureType}"/>
                <ComboBox Grid.Column="1" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="auto" Name="cmbPictureType"  >
                    <ComboBox.Items>
                        <ComboBoxItem Content="{x:Static res:Resources.txt_ImageNo}" Name="cmiImageNo"/>                        
                        <ComboBoxItem Content="{x:Static res:Resources.txt_ImageGeometry}" Name="cmiImageGeometry"/>
                        <ComboBoxItem Content="{x:Static res:Resources.txt_ImageLogo}" Name="cmiImageLogo"/>
                        <ComboBoxItem Content="{x:Static res:Resources.txt_ImageDrawing}" Name="cmiImageDrawing"/>
                        <ComboBoxItem Content="{x:Static res:Resources.txt_ImagePhoto}" Name="cmiImagePhoto"/>
                    </ComboBox.Items>
                </ComboBox> 
            </Grid>
        </GroupBox>
        <!--Colors-->
        <GroupBox Header="{x:Static res:Resources.txt_Colors}" Grid.Column="1" Grid.Row="0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Background}" Target="{Binding ElementName=copBackround}"/>
                <my:ColorPicker Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" AllowNull="False" x:Name="copBackground" Grid.ColumnSpan="2" />
                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_SecondaryBackground}" Target="{Binding ElementName=copSecondaryBackground}"/>
                <my:ColorPicker Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" AllowDrop="False" x:Name="copSecondaryBackground" Grid.ColumnSpan="2"/>
                <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Foreground}" Target="{Binding ElementName=copForeground}"/>
                <my:ColorPicker Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" AllowNull="True" x:Name="copForeground" Grid.ColumnSpan="2" />
                <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Foreground2}" Target="{Binding ElementName=copForeground2}"/>
                <my:ColorPicker Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" AllowNull="True" x:Name="copForeground2" Grid.ColumnSpan="2" />
                <CheckBox Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Center" Name="chk3D" Content="{x:Static res:Resources.lbl_3D}"/>
                <RadioButton Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Center" Width="auto" IsChecked="True" Name="optMatting" Content="{x:Static res:Resources.lbl_Matting}"/>
                <RadioButton Grid.Column="2" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Center" Width="auto" Name="optGlossy" Content="{x:Static res:Resources.lbl_Glossy}"/>
            </Grid>
        </GroupBox>
        <!--Type and size-->
        <GroupBox Header="{x:Static res:Resources.txt_TypeInformation}" Grid.Column="0" Grid.Row="1" Grid.RowSpan="2">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <GroupBox Header="{x:Static res:Resources.txt_CapType}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="auto"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <RadioButton Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Width="auto" IsChecked="True" Name="optCapTypeSelect" Content="{x:Static res:Resources.lbl_SelectType}"/>
                        <ComboBox Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbCapType" Style="{StaticResource CapTypeTemplate}"
                                  IsEnabled="{Binding ElementName=optCapTypeSelect, Path=IsChecked, Mode=OneWay}" SelectedValuePath="CapTypeID" Grid.ColumnSpan="2" my:AttachedProperties.SelectNullOnDelete="true"/>
                        <RadioButton Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Left" Width="auto" Name="optCapTypeNew" Content="{x:Static res:Resources.lbl_NewType}"/>
                        <TextBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center"  HorizontalAlignment="Stretch" Name="txtCapTypeName" MaxLength="50"
                                 IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Grid.ColumnSpan="2" my:AttachedProperties.SelectAllOnFocus="true"/>
                        <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Top" HorizontalAlignment="Right"  Width="auto" IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Content="{x:Static res:Resources.lbl_Description}" Target="{Binding ElementName=txtCapTypeDesc}"/>
                        <TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AcceptsReturn="True" MinLines="2" TextWrapping="Wrap" Name="txtCapTypeDesc"
                                 IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Grid.ColumnSpan="2" my:AttachedProperties.SelectAllOnFocus="true"/>
                        <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Content="{x:Static res:Resources.lbl_Image}" Target="{Binding ElementName=txtCapTypeImagePath}"/>
                        <TextBox Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="txtCapTypeImagePath"
                                 IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Height="21.96" Width="204.267" my:AttachedProperties.SelectAllOnFocus="true"/>
                        <Button Grid.Column="2" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Center" Name="btnBrowseForCapTypeImage" Padding="3,0"
                                IsEnabled="{Binding ElementName=optCapTypeNew, Path=IsChecked, Mode=OneWay}" Content="{x:Static res:Resources.cmd_Browse}" ToolTip="{x:Static res:Resources.tot_Browse}"/>
                        <RadioButton Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.ColumnSpan="2" Width="auto" Name="optCapTypeAnonymous" Content="{x:Static res:Resources.lbl_AnonymousType}"/>

                    </Grid>
                </GroupBox>

                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_MainType}" Target="{Binding ElementName=cmbMainType}"/>
                <ComboBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbMainType" Style="{StaticResource MainTypeTemplate}" SelectedValuePath="MainTypeID" />
                <Button Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="auto" Name="btnNewMainType" Content="{x:Static res:Resources.cmd_New}"/>
                <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_Shape}" Target="{Binding ElementName=cmbShape}"/>
                <ComboBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbShape" SelectedValuePath="ShapeID" Style="{StaticResource ShapeTemplate}"/>
                <Button Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="auto" Name="cmdNewShape" Content="{x:Static res:Resources.cmd_New}"/>
                <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Target="{Binding ElementName=nudSize1}"
                       Content="{Binding ElementName=cmbShape, Path=SelectedItem.Size1Name, Mode=OneWay}"/>
                <Tools:NumericUpDown Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" Maximum="1000000" Name="nudSize1" />
                <Label Grid.Column="2" Grid.Row="3" VerticalAlignment="Center" Width="auto" HorizontalAlignment="Left" Content="{x:Static res:Resources.abb_Millimeters}"/>
                <Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Target="{Binding ElementName=nudSize2}"
                       Content="{Binding ElementName=cmbShape, Path=SelectedItem.Size2Name, Mode=OneWay}"
                       IsEnabled="{Binding ElementName=cmbShape, Path=SelectedItem.Size2Name, Mode=OneWay, Converter={StaticResource NullFalseConverter}}"/>
                <Tools:NumericUpDown Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Stretch" Maximum="1000000" Name="nudSize2" 
                                     IsEnabled="{Binding ElementName=cmbShape, Path=SelectedItem.Size2Name, Mode=OneWay, Converter={StaticResource NullFalseConverter}}"/>
                <Label Grid.Column="2" Grid.Row="4" VerticalAlignment="Center" Width="auto" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=cmbShape, Path=SelectedItem.Size2Name, Mode=OneWay, Converter={StaticResource NullFalseConverter}}" Content="{x:Static res:Resources.abb_Millimeters}"/>
                <Label Grid.Column="0" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_Height}" Target="{Binding ElementName=nudHeight}"/>
                <Tools:NumericUpDown Grid.Column="1" Grid.Row="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" Maximum="1000000" Name="nudHeight" />
                <Label Grid.Column="2" Grid.Row="5" VerticalAlignment="Center" Width="auto" HorizontalAlignment="Left" Content="{x:Static res:Resources.abb_Millimeters}"/>
                
                <Label Grid.Column="0" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_Material}" Target="{Binding ElementName=cmbMaterial}"/>
                <ComboBox Grid.Column="1" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbMaterial" Style="{StaticResource MaterialTemplate}" SelectedValuePath="MaterialID" />
                <Button Grid.Column="2" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Stretch"  Width="auto" Name="btnNewMaterial" Margin="0" Content="{x:Static res:Resources.cmd_New}"/>
                
                <Label Grid.Column="0" Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_Target}" Target="{Binding ElementName=cmbTarget}"/>
                <ComboBox Grid.Column="1" Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbTarget" Style="{StaticResource TargetTemplate}" SelectedValuePath="TargetID" my:AttachedProperties.SelectNullOnDelete="true"/>
                <Button Grid.Column="2" Grid.Row="7" VerticalAlignment="Center" HorizontalAlignment="Stretch"  Width="auto" Name="btnNewTarget" Margin="0" Content="{x:Static res:Resources.cmd_New}"/>

                <Label Grid.Column="0" Grid.Row="8" VerticalAlignment="Top" HorizontalAlignment="Right"  Width="auto" Content="{x:Static res:Resources.lbl_Sign}" Target="{Binding ElementName=icSigns}"/>
                <ItemsControl Name="icSigns" ComboBox.SelectionChanged="cmbSign_SelectionChanged" Template="{StaticResource ScrollableItemsControl}" Grid.Column="1" Grid.Row="8" Grid.ColumnSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Top" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <StackPanel Orientation="Vertical" IsItemsHost="True" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <ComboBox HorizontalAlignment="Stretch" Name="cmbSign" Style="{StaticResource SignTemplate}"
                                        SelectedValuePath="CapSignID" KeyDown="cmbSign_KeyDown" Loaded="cmbSign_Loaded"
                                        SelectedItem="{Binding CapSign, Mode=TwoWay}"  />
                            <!--SelectionChanged="cmbSign_SelectionChanged"-->
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <Grid Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="2" Height="auto" HorizontalAlignment="Stretch">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto"/>
                    </Grid.RowDefinitions>
                    <Button Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="auto" Name="btnAddSign" Margin="0" Content="{x:Static res:Resources.cmd_AddSign}"/>
                    <Button Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Stretch" Width="auto" Name="btnNewSign" Margin="0" Content="{x:Static res:Resources.cmd_NewSign}"/>
                </Grid>
                
                <GroupBox Grid.Column="0" Grid.Row="10" Grid.ColumnSpan="3" VerticalAlignment="Top" HorizontalAlignment="Stretch" Height="auto" Header="{x:Static res:Resources.txt_TypeSuggestor}" IsEnabled="{Binding ElementName=optCapTypeSelect, Path=IsChecked, Mode=OneWay, Converter={StaticResource NotBooleanValueConverter}}">
                    <my:TypeSuggestor x:Name="tysSuggestor" HorizontalAlignment="Stretch" Height="auto" IsEnabled="{Binding ElementName=optCapTypeSelect, Path=IsChecked, Mode=OneWay, Converter={StaticResource NotBooleanValueConverter}}"
                                      MainType="{Binding ElementName=cmbMainType, Path=SelectedItem}"
                                      Shape="{Binding ElementName=cmbShape, Path=SelectedItem}"
                                      Size1="{Binding ElementName=nudSize1, Path=Value}"
                                      Size2="{Binding ElementName=nudSize2, Path=Value}"
                                      CapHeight="{Binding ElementName=nudHeight, Path=Value}"
                                      Material="{Binding ElementName=cmbMaterial, Path=SelectedItem}"
                                      TargetObject="{Binding ElementName=cmbTarget, Path=SelectedItem}"
                                      />
                </GroupBox>
            </Grid>
        </GroupBox>
        <!--Texts-->
        <GroupBox Grid.Row="1" Grid.Column="1" Header="{x:Static res:Resources.txt_Texts}" Grid.RowSpan="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid>
                <Grid.RowDefinitions >
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions >
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Label Grid.Row="0" Content="{x:Static res:Resources.lbl_TopText}" Target="{Binding ElementName=txtTopText}"/>
                <TextBox Grid.Row="1" AcceptsReturn="True" TextWrapping="Wrap" Name="txtTopText" VerticalScrollBarVisibility="Auto" my:AttachedProperties.SelectAllOnFocus="true" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                <Label Grid.Row="2" Content="{x:Static res:Resources.lbl_SideText}" Target="{Binding ElementName=txtSideText}"/>
                <TextBox Grid.Row="3" AcceptsReturn="True" TextWrapping="Wrap" Name="txtSideText" VerticalScrollBarVisibility="Auto" my:AttachedProperties.SelectAllOnFocus="true" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                <Label Grid.Row="4" Content="{x:Static res:Resources.lbl_BottomText}" Target="{Binding ElementName=txtBottomText}"/>
                <TextBox Grid.Row="5" AcceptsReturn="True" TextWrapping="Wrap" Name="txtBottomText" VerticalScrollBarVisibility="Auto" my:AttachedProperties.SelectAllOnFocus="true" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
                <Label Grid.Row="6" Content="{x:Static res:Resources.lbl_Note}" Target="{Binding ElementName=txtNote}"/>
                <TextBox Grid.Row="7" AcceptsReturn="True" TextWrapping="Wrap" Name="txtNote" VerticalScrollBarVisibility="Auto" my:AttachedProperties.SelectAllOnFocus="true" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
            </Grid>
        </GroupBox>
        <!--Misc-->
        <GroupBox Grid.Column="2" Grid.Row="0" Header="{x:Static res:Resources.txt_Miscellaneous}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions >
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <Label Grid.Column="0" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_ID}" Target="{Binding ElementName=lblID}"/>
                <Label Grid.Column="1" Grid.Row="0" VerticalAlignment="Center" HorizontalAlignment="Left" Name="lblID"/>
                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Year}" Target="{Binding ElementName=nudYear}"/>
                <Tools:NumericUpDown Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Minimum="0" Maximum="9999" Value="0" ToolTip="{x:Static res:Resources.tot_0NotSet}" Grid.ColumnSpan="2" Name="nudYear"/>
                <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Country}" Target="{Binding ElementName=txtCountryCode}"/>
                <TextBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" ToolTip="{x:Static res:Resources.tot_ISO2}" MaxLines="1" MaxLength="2" Name="txtCountryCode" my:AttachedProperties.SelectAllOnFocus="true"/>
                <StackPanel Width="auto" Height="auto"  Grid.Column="2" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Image MaxHeight="16" MaxWidth="32" Width="auto" Height="auto" Source="{Binding ElementName=txtCountryCode, Path=Text, Mode=OneWay, Converter={StaticResource CountryCodeFlagConverter}}"  />
                    <Button Name="btnCCCountry"  VerticalAlignment="Center" Width="auto" Content="{x:Static res:Resources.cmd_More}" IsTabStop="False" />
                </StackPanel>

                <Label Grid.Column="0" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_CountryOfOrigin}" Target="{Binding ElementName=txtCountryOfOrigin}"/>
                <TextBox Grid.Column="1" Grid.Row="3" VerticalAlignment="Center" HorizontalAlignment="Stretch" ToolTip="{x:Static res:Resources.tot_ISO2}" MaxLines="1" MaxLength="2" Name="txtCountryOfOrigin" my:AttachedProperties.SelectAllOnFocus="true"/>
                <StackPanel Width="auto" Height="auto"  Grid.Column="2" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Image MaxHeight="16" MaxWidth="32" Width="auto" Height="auto" Source="{Binding ElementName=txtCountryOfOrigin, Path=Text, Mode=OneWay, Converter={StaticResource CountryCodeFlagConverter}}"  />
                    <Button Name="btnCCCountryOfOrigin"  VerticalAlignment="Center" Width="auto" Content="{x:Static res:Resources.cmd_More}" IsTabStop="False" />
                </StackPanel>

                <Label Grid.Column="0" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Storage}" Target="{Binding ElementName=cmbStorage}"/>
                <ComboBox Grid.Column="1" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbStorage" Style="{StaticResource StorageTemplate}" SelectedValuePath="StorageID" />
                <Button Grid.Column="2" Grid.Row="4" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="btnNewStorage" Content="{x:Static res:Resources.cmd_New}"/>
                <StackPanel Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center" Width="auto" Height="auto"  Orientation="Horizontal">
                    <CheckBox Name="chkHasBottom" Content="{x:Static res:Resources.lbl_HasBottom}" Margin="0,0,5,0"/>
                    <CheckBox Name="chkHasSide" Content="{x:Static res:Resources.lbl_HasSide}" Margin="5,0,0,0"/>
                </StackPanel>
                <Label Grid.Column="0" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_CapState}" ToolTip="{x:Static res:Resources.tot_CapState}" Target="{Binding ElementName=nudCapState}"/>
                <Tools:NumericUpDown Grid.Column="1" Grid.Row="6" VerticalAlignment="Center" HorizontalAlignment="Stretch" Minimum="1" Maximum="5" Value="1" ToolTip="{x:Static res:Resources.tot_CapState}" Grid.ColumnSpan="2" Name="nudCapState"/>
            </Grid>
        </GroupBox>
        <!--Product-->
        <GroupBox Grid.Column="2" Grid.Row="1" Header="{x:Static res:Resources.txt_CompanyProduct}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>
                <GroupBox  Grid.Column="0" Grid.ColumnSpan="3" Grid.Row="0" Header="{x:Static res:Resources.txt_ProductSelection}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                            <RowDefinition Height="auto"/>
                        </Grid.RowDefinitions>
                        <RadioButton Grid.Column="0" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Center" Name="optProductSelected" Content="{x:Static res:Resources.lbl_SelectProduct}"/>
                        <ComboBox Grid.Column="1" Grid.Row="0" HorizontalAlignment="Stretch"  VerticalAlignment="Center" Name="cmbProduct" Style="{StaticResource ProductTemplate}"
                                  IsEnabled="{Binding ElementName=optProductSelected, Path=IsChecked, Mode=OneWay}" my:AttachedProperties.SelectNullOnDelete="true"/>
                        <RadioButton Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" Name="optProductNew" Content="{x:Static res:Resources.lbl_NewProduct}"/>
                        <TextBox Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Name="txtProductName"  MaxLength="50" 
                                 IsEnabled="{Binding ElementName=optProductNew, Path=IsChecked, Mode=OneWay}" my:AttachedProperties.SelectAllOnFocus="true"/>
                        <Label Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Top" Content="{x:Static res:Resources.lbl_Description}" Target="{Binding ElementName=txtProductDescription}"/>
                        <TextBox Grid.Column="1" Grid.Row="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinLines="2" AcceptsReturn="True" TextWrapping="Wrap" Name="txtProductDescription"
                                 IsEnabled="{Binding ElementName=optProductNew, Path=IsChecked, Mode=OneWay}" my:AttachedProperties.SelectAllOnFocus="true"/>
                        <RadioButton Grid.Column="0" Grid.Row="3" HorizontalAlignment="Left" Grid.ColumnSpan="2" VerticalAlignment="Center" IsChecked="True" Name="optProductAnonymous" Content="{x:Static res:Resources.lbl_AnonymousProduct}"/>
                    </Grid>
                </GroupBox>
                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_ProductType}" Target="{Binding ElementName=cmbProductType}"/>
                <ComboBox Grid.Column="1" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbProductType" Style="{StaticResource ProductTypeTemplate}" SelectedValuePath="ProductTypeID" my:AttachedProperties.SelectNullOnDelete="true"/>
                <Button Grid.Column="2" Grid.Row="1" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="btnNewProductType" Content="{x:Static res:Resources.cmd_New}"/>
                <Label Grid.Column="0" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Right" Width="auto" Content="{x:Static res:Resources.lbl_Company}" Target="{Binding ElementName=cmbCompany}"/>
                <ComboBox Grid.Column="1" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="cmbCompany" Style="{StaticResource CompanyTemplate}" SelectedValuePath="CompanyID" my:AttachedProperties.SelectNullOnDelete="true"/>
                <Button Grid.Column="2" Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Stretch" Name="btnNewCompany" Content="{x:Static res:Resources.cmd_New}"/>
                <StackPanel Grid.Column="1" Grid.ColumnSpan="3" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Row="3" Orientation="Horizontal">
                    <CheckBox VerticalAlignment="Center" Name="chkIsDrink" IsThreeState="True" Content="{x:Static res:Resources.lbl_IsDrink}" IsChecked="{x:Null}" />
                    <CheckBox VerticalAlignment="Center" Name="chkIsAlcoholic" IsThreeState="True" Content="{x:Static res:Resources.lbl_IsAlcoholic}" IsChecked="{x:Null}" />
               </StackPanel>
            </Grid>

        </GroupBox>
        <!--Categories and keywords-->
        <GroupBox Grid.Column="2" Grid.Row="2" Header="{x:Static res:Resources.txt_CategoriesKeywords}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/> 
                </Grid.ColumnDefinitions>
                <ItemsControl Grid.ColumnSpan="2"  Grid.Column="0" Grid.Row="0" Name="lstCategories" MinHeight="48pt" Height="auto" MaxHeight="96pt" TextSearch.TextPath="Category.CategoryName" ScrollViewer.HorizontalScrollBarVisibility="Disabled"  ScrollViewer.VerticalScrollBarVisibility="Auto" IsTabStop="False" Template="{StaticResource ScrollableItemsControl}" >
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <CheckBox IsChecked="{Binding Checked, Mode=TwoWay}"  ToolTip="{Binding Category.Description}" Checked="lstCategories_CheckedChanged" Unchecked="lstCategories_CheckedChanged" >
                                <CheckBox.Content>
                                    <StackPanel Orientation="Horizontal">
                                        <TextBlock Text="{Binding Category.CategoryName, Mode=OneWay}" Margin="0,0,3,0"/>
                                        <TextBlock>(</TextBlock>
                                        <TextBlock Text="{Binding Category.CategoryID, Mode=OneWay}"/>
                                        <TextBlock>)</TextBlock>
                                    </StackPanel>
                                </CheckBox.Content>
                            </CheckBox>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Orientation="Horizontal" IsItemsHost="True" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
                <Button Grid.Column="1" Grid.Row="1" VerticalAlignment="Top" HorizontalAlignment="Right" Width="auto" Name="btnNewCategory" Content="{x:Static res:Resources.cmd_NewCategory}"/>
                <Label Grid.Column="0" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="auto" Content="{x:Static res:Resources.lbl_Keywords}" Target="{Binding ElementName=wfhKeywords}"/>
                <wfi:WindowsFormsHost Grid.Column="0" Grid.Row="2" Height="auto" HorizontalAlignment="Stretch" MinHeight="100" Name="wfhKeywords" Grid.ColumnSpan="2">
                    <ToolsWF:KeyWordsEditor Dock="Fill" Name="kweKeywords" x:Name="kweKeywords" ThesaurusButtonState="Hidden" MergeButtonState="Hidden" StatusState="Hidden"/>
                </wfi:WindowsFormsHost>
            </Grid>
        </GroupBox>
        <!--Images-->
        <GroupBox Grid.Column="0" Grid.Row="3" Grid.ColumnSpan="2" Header="{x:Static res:Resources.txt_Images}">
            <Grid>
                <Grid.ColumnDefinitions >
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <ListBox Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="lvwImages" MinHeight="100">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel Orientation="Horizontal" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Auto" IsItemsHost="True" ItemHeight="100" ItemWidth="64"/>
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Width="64" Height="100"  ToolTipService.ShowDuration="{x:Static sys:Int32.MaxValue}"
                                  MouseDown="Image_MouseDown">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="64"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="64"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Grid.ToolTip>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="256"/>
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition MaxHeight="256" Height="auto" />
                                            <RowDefinition Height="auto"/>
                                        </Grid.RowDefinitions>
                                        <Image MaxWidth="256" MaxHeight="256" HorizontalAlignment="Center"  
                                                Source="{Binding ., Mode=OneWay, Converter={StaticResource ObjectImageConverter}, ConverterParameter={StaticResource i256}}"
                                                Width="auto" Height="auto"/>
                                        <TextBlock Text="{Binding RelativePath, Mode=OneWay}" Grid.Column="0" Grid.Row="1"/>
                                    </Grid>
                                </Grid.ToolTip>
                                <Image Source="{Binding ., Mode=OneWay, Converter={StaticResource ObjectImageConverter}, ConverterParameter={StaticResource i64}}"
                                       MaxWidth="64" MaxHeight="64" Width="auto" Height="auto"
                                       Grid.ZIndex="0"/>
                                <TextBlock HorizontalAlignment="Center" VerticalAlignment="Top" Grid.Row="1" Grid.Column="0"
                                           Text="{Binding RelativePath, Mode=OneWay, Converter={StaticResource FileNameConverter}}"
                                           Width="auto" Height="auto" TextWrapping="Wrap" TextAlignment="Center"/>
                                <CheckBox Grid.Column="0" Grid.Row="0"
                                          HorizontalAlignment="Right" VerticalAlignment="Top"
                                          IsChecked="{Binding Path=IsMain, Mode=TwoWay}"
                                          ToolTip="{x:Static res:Resources.tot_MainImage}"
                                          Grid.ZIndex="1"/>
                            
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <!--<ListView  Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="lvwImages" MinHeight="100" >
                    <ListView.View >
                        <my:ImageView />
                    </ListView.View>
                </ListView>-->
                <Button Grid.Column="1" Grid.Row="0" HorizontalAlignment="Left" VerticalAlignment="Bottom" Name="btnAddImage" Content="{x:Static res:Resources.cmd_Add}"/>
            </Grid>
        </GroupBox>
        <!--Buttons-->
        <Grid Grid.Column="2" Grid.Row="3" Height="auto" Width="auto" HorizontalAlignment="Right" VerticalAlignment="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
                <RowDefinition Height="auto"/>
            </Grid.RowDefinitions>
            <Button Margin="3" Padding="3,0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="0" Grid.ColumnSpan="2" Name="btnSearch" Content="{x:Static res:Resources.cmd_CapsSearchSimilar}"/>
            <Button Margin="3" Padding="3,0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1" Name="btnSave" Content="{x:Static res:Resources.cmd_SaveCap}"/>
            <Button Margin="3" Padding="3,0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Grid.Row="1" Name="btnCancel" Content="{x:Static res:Resources.cmd_Cancel}"/>
            <!--<Button Margin="3" Padding="3,0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Name="btnSaveNext" Content="{x:Static res:Resources.cmd_SaveNext}" Visibility="Collapsed" />-->
            <m:SplitButton Margin="3" Padding="3,0" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="2" Name="btnSaveNext" Content="{x:Static res:Resources.cmd_SaveNext}" Visibility="Collapsed">
                <MenuItem Name="mniSaveAndNext" Header="{x:Static res:Resources.mni_SaveNext}"/>
                <MenuItem Name="mniSaveAndNextNoClean" Header="{x:Static res:Resources.mni_SaveNextNoClean}"/>
                <MenuItem Name="mniSaveAndPrevious" Header="{x:Static res:Resources.mni_SavePrevious}"/>
                <MenuItem Name="mniSaveAndNew" Header="{x:Static res:Resources.mni_SaveNew}"/>
                <MenuItem Name="mniPreviousNoSave" Header="{x:Static res:Resources.mni_PreviousNoSave}"/>
                <MenuItem Name="mniNextNoSave" Header="{x:Static res:Resources.mni_NextNoSave}"/>
                <MenuItem Name="mniReset" Header="{x:Static res:Resources.mni_Reset}"/>
            </m:SplitButton>
        </Grid>
        <TextBox Grid.Column="2" Grid.Row="3" HorizontalAlignment="Stretch" VerticalAlignment="Top" 
                 Text="{Binding Path=FavoriteCharacters, Mode=TwoWay, Source={x:Static my:MySettings.Default}}"
                 ToolTip="{x:Static res:Resources.tot_FavoriteCharacters}"
                 FontSize="24pt" IsReadOnly="True"
                 Name="txtFavoriteCharacters"/>
        <StatusBar Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="3" HorizontalAlignment="Stretch">
            <Label Content="{x:Static res:Resources.lbl_CapsCounts}"/>
            <Label Name="lblCapsCount"/>
        </StatusBar>
    </Grid>
</UserControl>
    